package club.pinea;

import club.pinea.client.GameClient;
import club.pinea.client.LoginClient;
import club.pinea.util.PrintUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
 * 客户端的启动类
 */
@SpringBootApplication(scanBasePackages = {
        "club.pinea.client",
        "club.pinea.config",
        "club.pinea.utils",
        "club.pinea",
})
public class ClientApplication implements CommandLineRunner {

    @Autowired
    private LoginClient loginClient;

    public static void main(String[] args) {
        new SpringApplicationBuilder(ClientApplication.class).web(WebApplicationType.NONE).run(args);
    }


    @Override
    public void run(String... args) throws Exception {
        PrintUtil.printHello();
        new Thread(loginClient).start();
    }
}
